use std::env;
use std::process;
use my_rust::Config;

fn main() {
  let config = Config::new(env::args())
    .unwrap_or_else(|err| {
      eprintln!("argment is err: {}", err);
      process::exit(1);
  });

  println!("query is: {}", config.query);
  println!("file is: {}", config.filename);

  if let Err(e) = my_rust::run(config) {
    eprintln!("err is {}", e);
    process::exit(1);
  }
}
